pub fn run_example() -> () {
    let a = 12_333;
    println!("a is {0}, a again is {0}, {{}}", a);

    // 浮点数型
    let x = 2.0; // f64
    let y: f32 = 3.0; // f32
    println!("f64 x is {:.2}, f32 y is {:.2}", x, y);

    // 数学运算
    let sum = 5 + 10; // 加
    let diff = 95.5 - 4.3; // 减
    let product = 4 * 30; // 乘
    let quotient = 56.7 / 32.2; // 除
    let remainder = 43 % 5; // 取余
    let mut selfadd = 10;
    selfadd += 1; // 自增, Rust 不支持 ++ ， --
    println!(
        "sum is {}, diff is {}, product is {}, quotient is {:.2}, remainder is {}, selfadd is {}",
        sum, diff, product, quotient, remainder, selfadd
    );

    // 复合类型
    // 元组，用一对()包括的一组数据，可以包含不同个种类的数据
    let tup: (i32, f64, u8) = (500, 6.4, 1);
    // tup.0 等于 500
    // tup.1 等于 6.4
    // tup.2 等于 1
    let (x, y, z) = tup;
    println!("In tuple, x is {}, y is {}, z is {}", x, y, z);

    // 数组，用一对[]包括的同类型数据
    // a 是一个长度为 5 的整型数组
    let a = [1, 2, 3, 4, 5];

    // b 是一个长度为 3 的字符串数组
    let b = ["January", "February", "March"];

    // c 是一个长度为 5 个 i32 数组
    let c: [i32; 5] = [1, 2, 3, 4, 5];

    // 等同于 let d = [3, 3, 3, 3, 3]
    let d: [i32; 5] = [3; 5];
    println!("In array, a is {:?}, b is {:?}, c is {:?}, d is {:?}", a, b, c, d);

    // 数组的访问
    let first = a[0];
    let second = a[1];
    // a[2] = 6; // 错误：数组 a 不可变, let mut a = [1, 2, 3];
    println!("In array, first is {}, second is {}", first, second);
}
